// 菜单管理员端
import request from "@/service/request";

// 开关单
export function enableBilling(params) {
    return request({
        url: `/api/enable/cut`,
        method: "PUT",
        params
    })
}

// 获取开单状态
// export function getBillingType() {
//     return request({
//         url: `/api/get/cut`,
//         method: "GET",
//     })
// }

// 添加菜品
export function addGoods(data) {
    return request({
        url: `/menu/stick/dishes`,
        method: "POST",
        data
    });
}

// 查询/获取全部菜品
export function getGoods(data) {
    return request({
        url: `/menu/page/dishes`,
        method: "POST",
        data
    });
}

// 修改菜品
export function changeGoods(data) {
    return request({
        url: `/menu/update/dishes`,
        method: "PUT",
        data
    });
}

// 修改时获取菜品详情
export function getGoodDetail(data) {
    return request({
        url: `/menu/select/dishes`,
        method: "POST",
        data
    });
}

// 删除菜品
export function deleteGoods(data) {
    return request({
        url: `/menu/delete/dishes`,
        method: "POST",
        data
    });
}

// 模糊查询菜品
export function getLikeGoods(params) {
    return request({
        url: `/menu/like`,
        method: "GET",
        params
    })
}

// 获取会员卡
export function getVipCards() {
    return request({
        url: `/menu/get/card/type`,
        method: "GET",
    });
}

// 获取会员卡下所有菜
export function getVipCardGoods(data) {
    return request({
        url: `/menu/get/card/dishes`,
        method: "POST",
        data
    });
}

// 添加会员卡中的菜品
export function addVipCardGoods(data) {
    return request({
        url: `/menu/stick/card/dishes`,
        method: "POST",
        data
    });
}

// 点击修改会员卡下获取菜品详情
// export function getChangeGoodDetail(params) {
//     return request({
//         url: `/menu/deliveryCycle`,
//         method: 'GET',
//         params
//     })
// }

// 点击修改会员卡下菜参数
export function changeGoodDetail(data) {
    return request({
        url: `/menu/update/card/dishes`,
        method: 'PUT',
        data
    })
}

// 删除会员卡中的菜品
export function deleteVipCardGoods(data) {
    return request({
        url: `/menu/delete/card/dishes`,
        method: "DELETE",
        data
    });
}

// 上传图片
export function upLoadImg(data, fileObj) {
    return request({
        url: `/u/api/upload`,
        method: "POST",
        data,
        type: 'upload'
    });
}

// 添加会员卡菜分类上限
export function addVipGoodCat(data) {
    return request({
        url: `/menu/new/card/cap`,
        method: "POST",
        data
    });
}

// 查看会员卡菜分类上限
export function getVipGoodCat(data) {
    return request({
        url: `/menu/get/card/cap`,
        method: "POST",
        data
    });
}

// 修改会员卡菜分类上限
export function changeVipGoodCat(data) {
    return request({
        url: `/menu/up/card/cap`,
        method: "POST",
        data
    });
}

// 获取会员卡菜详情图
export function getGoodDImg(params) {
    return request({
        url: `/menu/select/photo`,
        method: "GET",
        params
    });
}

// 修改会员卡菜详情图
export function changeGoodDImg(data) {
    return request({
        url: `/menu/stick/photo`,
        method: "POST",
        data
    });
}
// 改变首页显示
export function changeHomePage(params) {
    return request({
        url: `/menu/dishes/homePage`,
        method: "GET",
        params
    });
}
